package enums;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public enum OzWitch {

    // Instances must be defined first, before methods:
    WEST("Miss Gulch, aka the Wicked Witch of the West"),
    NORTH("Glinda, the Good Witch of the North"),
    EAST("Wicked Witch of the East, wearer of the Ruby " +
         "Slippers, crushed by Dorothy's house"),
    SOUTH("Good by inference, but missing");

    private final String description;
    // Constructor must be package or private access:
    private OzWitch(String description) {
        this.description = description;
    }
    public String getDescription() { return description; }

    @Override public String toString() {
        String id = name();
        String lower = id.substring(1)
            .toLowerCase();
        return id.charAt(0) + lower;
    }

    public static void main(String[] args) {
        for(OzWitch witch : OzWitch.values()) {
            log.error("{}:{}",witch,witch.getDescription());
        }
    }

}
